APP = {}
window.APP = APP

APP.app = {}
APP.view = {}

APP.config =
    resourceRoot: "/r/"
    apiRoot: "/api/"

APP.help = {}

toast = (message, level)->
    $t = $("<div class='toast #{level}'>#{message}</div>").appendTo($('.toasts'))
    remove = ->
        $t.slideUp ->
            $t.remove()
    setTimeout remove, 2000

APP.toastInfo = (message)->
    toast(message, 'info')

APP.toastWarn = (message)->
    toast(message, 'warn')

APP.toastError = (message)->
    toast(message, 'error')